package com.wey.controller;

import com.wey.R;
import com.wey.vo.UserVo;
import com.wey.service.IUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RequestMapping("/user")
@RestController
public class UserController {

    @Resource
    private IUserService userService;

    @GetMapping("/querUser")
    @ApiOperation(value = "查询用户")
    public R<UserVo> querUser(){
        UserVo userVo = new UserVo();
        userVo.setUserId(1);
        userVo.setUserName("wey");
        return R.data(userVo);
    }

    @GetMapping("/querUserByUserName")
    @ApiOperation(value = "根据用户名查询用户")
    public R<UserVo> querUserByUserName(@RequestParam String userName){
        return R.data(userService.querUserByUserName(userName));
    }
}









